package com.example.anew.journey.mynewjourney.logic.addDevices.persenter;

import com.example.anew.journey.mynewjourney.logic.addDevices.view.ISAddDeviecsView;

/**
 * 杭州惟君医疗科技有限公司15
 * Created by 20433 on 2018/3/8
 */

public class AddDeviecsPersenter {
    private ISAddDeviecsView mISAddDeviecsView;
    public AddDeviecsPersenter(ISAddDeviecsView isAddDeviecsView) {
        this.mISAddDeviecsView = isAddDeviecsView;
    }
    // 绑定设备
    public void  bandingDevics(){
        mISAddDeviecsView.showToastInformation("绑定成功");
        //mISAddDeviecsView.showBindingFailure();
        // todo 访问后台绑定设备
        mISAddDeviecsView.setBtNextContent("解除绑定");
    }
    // 解除绑定
    public void  removeBandingDevices(){
        mISAddDeviecsView.showToastInformation("解除成功");
        // todo 访问后台解除绑定设备
        mISAddDeviecsView.setBtNextContent("下一步");
    }
    // 下一步
    public void  onClickBtNext(){
       String str =  mISAddDeviecsView.getBtNextContent();
        if(str.equals("下一步")){  //下一步的逻辑
            mISAddDeviecsView.showInputBandingCode();
        }else if(str.equals("解除绑定")){ //解除绑定的逻辑
            mISAddDeviecsView.showRemoveBinding();
        }
    }
    //输入绑定的码 取消
    public  void cancelInputBandingCode(){
        mISAddDeviecsView.cancelInputBandingCode();
    }
    //输入绑定的  确认绑定
    public void inputBandingCodeConfirmBinding(){
        mISAddDeviecsView.inputBandingCodeConfirmBinding();
        mISAddDeviecsView.showBindingFailure();
       // bandingDevics();
    }
    //绑定失败 结束绑定
    public void bindingFailureEndBinding(){
        mISAddDeviecsView.bindingFailureEndBinding();
    }
    //绑定失败 重新绑定
    public void bindingFailureRebind(){
        mISAddDeviecsView.bindingFailureRebind();
       // mISAddDeviecsView.showInputBandingCode();
        bandingDevics();
    }
    //解除绑定 我在想想
    public void verifyBindingFailedIThink(){
        mISAddDeviecsView.removeBindingIThink();
    }
    //解除绑定 确认解绑
    public void verifyBindingFailedConfirmUnbundling(){
        mISAddDeviecsView.removeBindingConfirmUnbundling();
        removeBandingDevices();
    }
}
